<?php

class LyAutoIdBehavior extends CActiveRecordBehavior{
	public $uid = '';
	
	public function beforeValidate($event) {
		if (empty($this->owner->{$this->uid}))
			$this->owner->{$this->uid} = Yii::app()->adminUser->id;
	}
}

?>